package com.demo.view;
import android.content.Context;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;

import com.tange.base.toolkit.DimenUtil;
import com.tg.appcommon.android.TGApplicationBase;

import java.util.Objects;

public class TGBottomFullDialog extends BottomFullDialog {
    private static final float DP_BOTTOM_Y = 10.0f;
    private static final float DP_MARGIN_PADDING = 20.0f;

    public TGBottomFullDialog(Context context, View contentView) {
        super(context, contentView);
    }

    @Override
    public int getY(){
        return DimenUtil.dp2px(TGApplicationBase.getApplicationContext(), DP_BOTTOM_Y);
    }

    @SuppressWarnings("deprecation")
    public int getWidth() {
        WindowManager windowManager= Objects.requireNonNull(getWindow()).getWindowManager();
        Display display= windowManager.getDefaultDisplay();
        return display.getWidth() - DimenUtil.dp2px(TGApplicationBase.getApplicationContext(), DP_MARGIN_PADDING) ;
    }

}